package com.ck.system.service;

import com.ck.common.TreeSelect;
import com.ck.common.annotation.DataScope;
import com.ck.common.entity.SysDept;
import com.google.protobuf.ServiceException;

import java.util.List;

/**
 * @author changk
 * @date 2024/11/13 14:48
 * desc: 部门管理
 */
public interface SysDeptService {
    /**
     * 查询部门树结构信息
     *
     * @param dept 部门信息
     * @return 部门树信息集合
     */
    List<TreeSelect> selectDeptTreeList(SysDept dept);

    @DataScope(deptAlias = "d")
    List<SysDept> selectDeptList(SysDept dept);

    List<Long> selectDeptListByRoleId(Long roleId);

    boolean checkDeptNameUnique(SysDept dept);

    int insertDept(SysDept dept) throws ServiceException;

    void checkDeptDataScope(Long deptId) throws ServiceException;

    SysDept selectDeptById(Long deptId);

    int selectNormalChildrenDeptById(Long deptId);

    int updateDept(SysDept dept);
}
